package com.zian.domain.dto;

import com.zian.validation.ValidGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.util.List;

@Data
@ApiModel(description = "商品分类DTO")
public class CategoryDTO {

    @ApiModelProperty("分类id")
    @Null(message = "新增数据时id必须为空", groups = {ValidGroup.Crud.Create.class})
    @NotNull(message = "修改数据时id不能为空", groups = {ValidGroup.Crud.Update.class})
    private Long id;

    @ApiModelProperty("分类层级")
    @NotNull(message = "分类层级不弄为空")
    private List<Long> ancestors;

    @ApiModelProperty("分类名称")
    @NotBlank(message = "分类名称不能为空")
    private String categoryName;

    @ApiModelProperty("分类图标")
    private String icon;

    @ApiModelProperty("排序值(字段越大越靠前)")
    @NotNull(message = "排序值不能为空")
    private Integer categoryRank;
}
